package com.xwj;

import com.xwj.domain.database1.Order;
import com.xwj.service.TestService;
import com.xwj.service.database1.OrderService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.math.BigDecimal;

/**
 * @author xwj
 * @date 2020/12/11
 */
@SpringBootApplication
public class MultipleDatasourceApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(MultipleDatasourceApplication.class, args);
        OrderService orderService = context.getBean(OrderService.class);
//        Order order = new Order();
//        order.setUserId(13L);
//        order.setProductId(1L);
//        order.setCount(10);
//        order.setMoney(BigDecimal.valueOf(100));
//        order.setStatus(0);
//        orderService.create(order);

        TestService testService = context.getBean(TestService.class);
        testService.test();
    }
}
